#include <iostream>
#include "sharedMemory.hpp"
#include"Fifo.hpp"
using namespace std;



int main()
{
    
    shm.getShm();
    shm.attachShm();
    
    piPe.openPipeForWrite();
    // zdl:: 在这立进行 IPcs 
    data* image = static_cast<data*>(shm.getAddr());
    // std::cout << "client 虚拟的地址 ：" <<strinfo << std::endl; 
    printf("client 虚拟的地址 ：%p\n", image);
    char ch = 'A';
    while (ch <= 'Z')
    {
        strcpy(image->status, "最新");
        strcpy(image->lasttimme, getCurrentTime().c_str());
        strcpy(image->image, "XXXXXXXXXXXXX");
        piPe.signal();
        sleep(3);
    }

    std::cout << "currenttime: " << getCurrentTime().c_str() << std::endl;
    sleep(10);
    shm.detachShm();
    shm.deleteShm();
    return 0;

    return 0;
}